﻿using System;
using System.Web;

namespace DuJianliang.ApplicationPlatform.Common
{
    public class CurrentInfo
    {
        private CurrentInfo()
        {

        }

        public static CurrentInfo Instance
        {
            get
            {
                return new CurrentInfo();
            }
        }

        public Model.UserInfo CurrentUser
        {
            get
            {
                Model.UserInfo userInfo = HttpContext.Current.Session["UserInfo"] as Model.UserInfo;
                if (userInfo == null)
                {
                    return new Model.UserInfo();
                }
                return userInfo;
            }
            set
            {
                HttpContext.Current.Session["UserInfo"] = value;
            }
        } 
    }
}

